<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/common/top::head">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:replace="/common/top::header">

</div>
<div id="Content">

    <div id="BackLink">
        <a href="../catalog/MainController">Return to Main Menu</a>
    </div>

    <div id="Catalog">

        <div id="Cart">

            <h2>地址管理</h2>
            <div >
                <table>
                    <tr>
                        <th><b>地址</b></th>
                        <th>&nbsp;</th>
                    </tr>
                    <!-- 判断 -->


                    <tr th:each="address:${addresses}">
                        <td th:text="${address.getAddressContent()}"></td>
                        <td><a th:href="|RemoveAddressController?address_id=${address.getAddressId()}|" class="Button" >Remove</a></td>
                    </tr>

                    <tr th:if="${addresses.size()} eq '0'">
                        <td colspan="8"><b>Your addresses is empty.</b></td>
                    </tr>


                    <!--    <c:if test="${addresses.size()==0}">
                            <tr>
                                <td colspan="8"><b>Your addresses is empty.</b></td>
                            </tr>
                        </c:if>
                        &lt;!&ndash; 循环 &ndash;&gt;
                        <c:forEach items="${addresses}" var="address">
                            <tr>
                                <td>${address.addressContent}</td>
                                <td><a href="RemoveAddressController?address_id=${address.addressId}" class="Button" >Remove</a></td>
                            </tr>
                        </c:forEach>-->
                </table>
            </div>
            <form method="post" action="AddAddressController">
                <table>
                    <tr>
                        <td>新增地址</td>
                        <td><input name="address" type="text"></td>
                        <td><input type="submit"></td>
                    </tr>
                </table>
            </form>
        </div>

        <div id="MyList">
            <!-- 判断 -->
            <include file="IncludeMyList.html" />
        </div>

        <div id="Separator">&nbsp;</div>
    </div>
</div>
<div th:replace="common/bottom">

</div>
</body>
</html>